<?php get_header(); ?>
<div class="wrap">
	<div class="main">
<?php if ( is_author() ): ?>
<div class="author-box">
	<?php
		$info_name = get_post_meta($post->ID, 'name', true);
		$info_id = get_the_author_meta( 'ID' );
		if ( $info_id == 2 ):
			if ( $info_name != '' ):
				echo  '<p>本文作者：' . $info_name . '</p>';
			endif;
		else:
	?>
	<p><strong>本文版权优美文字网所有，转载引用请完整注明以下信息：</strong></p>
	<p>本文作者：<?php the_author();?></p>
	<?php endif;?>
	<?php if ( get_the_title() != '' ) : ?>
	<p>本文标题：<?php the_title(); ?></p>
	<?php endif;?>
	<p>本文地址：<?php
		    $pageURL = 'http';

			if ($_SERVER["HTTPS"] == "on") 
			{
				$pageURL .= "s";
			}
			$pageURL .= "://";
		
			if ($_SERVER["SERVER_PORT"] != "80") 
			{
				$pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
			} 
			else 
			{
				$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
			}
			echo $pageURL;
	
	?></p>
</div>
<?php endif;?>
<?php if(have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part('loop'); ?>
<?php endwhile; endif; ?>
	</div>
<?php get_sidebar(); ?>
<?php if (  $wp_query->max_num_pages > 1 ) : ?><div class="page-bar"><?php if (function_exists('pagenavi')) { pagenavi(); } ?></div><?php endif; ?>
</div>
<?php get_footer(); ?>